﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>Dependency Property (WPF)</Title>
      <Author>Laurent Bugnion (GalaSoft)</Author>
      <Description>Registers a DependencyProperty (WPF)</Description>
      <HelpUrl>http://www.galasoft.ch/mvvm/getstarted</HelpUrl>
      <Shortcut>mvvmpropdp</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <ID>property</ID>
          <ToolTip>Property Name</ToolTip>
          <Default>MyProperty</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>type</ID>
          <ToolTip>Property Type</ToolTip>
          <Default>Integer</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>ownerclass</ID>
          <ToolTip>The owning class of this Property.  Typically the class that it is declared in.</ToolTip>
          <Default>ownerclass</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>defaultvalue</ID>
          <ToolTip>The default value for this property.</ToolTip>
          <Default>0</Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      <Code Language="VB">
        <![CDATA[''' <summary>
''' The <see cref="$property$" /> dependency property's name.
''' </summary>
Public Const $property$PropertyName As String = "$property$"

''' <summary>
''' Gets or sets the value of the <see cref="$property$" />
''' property. This is a dependency property.
''' </summary>
Public Property $property$ as $type$ 
    Get
        return CType(GetValue($property$Property), $type$)
    End Get  
    Set
       SetValue($property$Property, value)
    End set
End Property

''' <summary>
''' Identifies the <see cref="$property$" /> dependency property.
''' </summary>
Public Shared ReadOnly $property$Property as DependencyProperty = DependencyProperty.Register(
    $property$PropertyName, 
    GetType($type$), 
    GetType($ownerclass$), 
    new UIPropertyMetadata($defaultvalue$))]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>